import {httpDelete, httpGet, httpPost, httpPut} from '@/utils/request'


export async function queryColumnGroup( params?:any ){
  const { data }  = await httpGet('/api/v1/data-media-pair/query-column-group',params)
  return data;
}

export async function findOne( id:any ){
  const { data ,success}   = await httpGet(`/api/v1/data-media-pair/findOne/${id}` )
  return { data ,success} ;
}

export async function findColumnPair( param:any ){
  const { data }  = await httpGet('/api/v1/data-media-pair/find-column-pair',param )
  return data;
}


export async function list( params?:any ){
  const { data ,success}  = await httpGet('/api/v1/data-media-pair/list',params)
  return {data,success};
}

export async function update( params?:any ){
  const { code }  = await httpPut('/api/v1/data-media-pair/modify',params)
  return code === 200;
}

export async function batchCreate( pipelineId:any, params?:any ){
  const { code }  = await httpPost(`/api/v1/data-media-pair/batch-create/${pipelineId}`,params)
  return code === 200;
}

export async function createColumnPair(params?:any ){
  const { code }  = await httpPost('/api/v1/data-media-pair/column-pair/create',params)
  return code === 200;
}

export async function createColumnGroup(params?:any ){
  const { code }  = await httpPost('/api/v1/data-media-pair/column-group/create',params)
  return code === 200;
}

export async function create( params?:any ){
  const { data }  = await httpPost('/api/v1/data-media-pair/create',params)
  return data;
}

export async function deleteById( id:any ){
  const { code }  = await httpDelete(`/api/v1/data-media-pair/delete/${id}` )
  return code === 200;
}

